package com.haixiaoke.saas.repository.service.impl;

import com.haixiaoke.saas.repository.mapper.ApartmentOrderChargeItemMapper;
import com.haixiaoke.saas.repository.pojo.ApartmentOrderChargeItem;
import com.haixiaoke.saas.repository.service.IApartmentOrderChargeItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;


/**
 * 公寓订单独有收费项目Service业务层处理
 *
 * @author qixi
 * @date 2023-06-16
 */
@Service
public class ApartmentOrderChargeItemServiceImpl implements IApartmentOrderChargeItemService {
    @Autowired
    private ApartmentOrderChargeItemMapper apartmentOrderChargeItemMapper;

    /**
     * 查询公寓订单独有收费项目
     *
     * @param itemId 公寓订单独有收费项目主键
     * @return 公寓订单独有收费项目
     */
    @Override
    public ApartmentOrderChargeItem selectApartmentOrderChargeItemByItemId(Long itemId) {
        return apartmentOrderChargeItemMapper.selectApartmentOrderChargeItemByItemId(itemId);
    }

    /**
     * 查询公寓订单独有收费项目列表
     *
     * @param apartmentOrderChargeItem 公寓订单独有收费项目
     * @return 公寓订单独有收费项目
     */
    @Override
    public List<ApartmentOrderChargeItem> selectApartmentOrderChargeItemList(ApartmentOrderChargeItem apartmentOrderChargeItem) {
        return apartmentOrderChargeItemMapper.selectApartmentOrderChargeItemList(apartmentOrderChargeItem);
    }

    /**
     * 新增公寓订单独有收费项目
     *
     * @param apartmentOrderChargeItem 公寓订单独有收费项目
     * @return 结果
     */
    @Override
    public int insertApartmentOrderChargeItem(ApartmentOrderChargeItem apartmentOrderChargeItem) {
        apartmentOrderChargeItem.setCreateTime(new Date());
        return apartmentOrderChargeItemMapper.insertApartmentOrderChargeItem(apartmentOrderChargeItem);
    }

    /**
     * 修改公寓订单独有收费项目
     *
     * @param apartmentOrderChargeItem 公寓订单独有收费项目
     * @return 结果
     */
    @Override
    public int updateApartmentOrderChargeItem(ApartmentOrderChargeItem apartmentOrderChargeItem) {
        apartmentOrderChargeItem.setUpdateTime(new Date());
        return apartmentOrderChargeItemMapper.updateApartmentOrderChargeItem(apartmentOrderChargeItem);
    }

    /**
     * 批量删除公寓订单独有收费项目
     *
     * @param itemIds 需要删除的公寓订单独有收费项目主键
     * @return 结果
     */
    @Override
    public int deleteApartmentOrderChargeItemByItemIds(Long[] itemIds) {
        return apartmentOrderChargeItemMapper.deleteApartmentOrderChargeItemByItemIds(itemIds);
    }

    /**
     * 删除公寓订单独有收费项目信息
     *
     * @param itemId 公寓订单独有收费项目主键
     * @return 结果
     */
    @Override
    public int deleteApartmentOrderChargeItemByItemId(Long itemId) {
        return apartmentOrderChargeItemMapper.deleteApartmentOrderChargeItemByItemId(itemId);
    }

    @Override
    public int insertApartmentOrderChargeItemBatch(List<ApartmentOrderChargeItem> apartmentItems) {
        return apartmentOrderChargeItemMapper.insertApartmentOrderChargeItemBatch(apartmentItems);
    }
}
